#include "CurvePlot.h"

#include <QVector>
#include <qwt_plot_curve.h>
#include <QtGui>

CurvePlot::CurvePlot(QwtPlot *parent)
{
  QTextStream cout(stdout,QIODevice::WriteOnly);
  QVector<double> time,mz;
  QStringList data;
  QFile file("test.txt");
  QTextStream myfile(&file);
  file.open(QIODevice::ReadOnly);
  for(int counter = 0;counter<2;counter++)
    {
      myfile.readLine();
    }
  do
    {
      QString line = myfile.readLine();
      data = line.split("\t");
      mz<<data.at(5).toFloat();
      time<<data.at(0).toFloat();
    }
  while(!myfile.atEnd());
  QwtPlotCurve *curve=new QwtPlotCurve("curve");
  //  curve->setData(time,mz);
  curve->attach(parent);
  parent->replot();
  parent->show();
}
